package kz.edu.sdu.itech.pcs.client;

import kz.edu.sdu.itech.pcs.common.Message;

public class MessageToServer extends Message {

   WorkerProtocol protocol;

   public MessageToServer(WorkerProtocol p) {
      protocol = p;
   }

   public boolean send() {
      boolean ok = true;
      try {
         protocol.out.println(toString());
         protocol.out.flush();
         if (AppProps.DEBUG)
            WorkerProtocol.log.debug(String.format("send to server: %s", toString()));
      } catch (Exception e) {
         e.printStackTrace();
         ok = false;
      }
      return ok;
   }

}
